package cn.iocoder.yudao.module.form.service.impl;

import cn.iocoder.yudao.module.form.dataobject.*;
import cn.iocoder.yudao.module.form.mysql.FormChartMapper;
import cn.iocoder.yudao.module.form.mysql.FormChartParamMapper;
import cn.iocoder.yudao.module.form.mysql.FormChooseChartMapper;
import cn.iocoder.yudao.module.form.mysql.SelfFormMapper;
import cn.iocoder.yudao.module.form.service.IFormChartParamService;
import cn.iocoder.yudao.module.form.service.IFormChartService;
import cn.iocoder.yudao.module.form.service.IFormChooseChartService;
import cn.iocoder.yudao.module.form.service.IFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.stream.Collectors;

@Service
public class FormServiceImpl implements IFormService {
    @Autowired
    private SelfFormMapper formMapper;

    @Autowired
    private FormChartMapper formChartMapper;

    @Autowired
    private FormChooseChartMapper formChooseChartMapper;

    @Autowired
    private FormChartParamMapper formChartParamMapper;

    @Autowired
    private IFormChooseChartService formChooseChartService;

    @Autowired
    private IFormChartService formChartService;

    @Autowired
    private IFormChartParamService formChartParamService;

    @Override
    public List<FormTable> getTable() {
        return formMapper.getTable();
    }

    @Override
    public List<FormTableColumn> getTableColumn(String tableName) {
        return formMapper.getTableColumn(tableName);
    }

    /**
     * 初始化报表
     *
     * @param formId 报选择主键
     * @return 报选择
     */
    @Override
    public ArrayList<FormChart> initForm(Long formId) {
        ArrayList<FormChart> chartlist=new ArrayList();

        FormChooseChart fcc = new FormChooseChart();
        fcc.setFormId(formId);

        //获取该表对应的所有图表id
        List<Long> chartIdList= formChooseChartService.selectFormChooseChartList(fcc)
                .stream().map(FormChooseChart::getChartId).collect(Collectors.toList());

        for (Long chartId:chartIdList){
            FormChart chart=formChartService.selectFormChartByChartId(chartId);

            FormChartParam fcp = new FormChartParam();
            fcp.setChartId(chartId);

            //获取该表对应的参数
            List<String> paral=formChartParamService.selectFormChartParamList(fcp)
                    .stream().sorted(Comparator.comparing(FormChartParam::getParaSort))
                    .map(FormChartParam::getParaName).collect(Collectors.toList());

            //将对应的参数赋给当前图表
            chart.setParalist(paral);

//            switch (chart.getChartType()){
//                case "基础折线图":{
//                    chart.setData(getlineChart(paral.get(0),paral.get(1),paral.get(2)));
//                    break;
//                }
//                case "堆叠柱状图":{
//                    chart.setData(getStackedColumnChart(paral.get(0),paral.get(1),paral.get(2), paral.get(3)));
//                    break;
//                }
//                default:{
//                    System.out.println("初始化错误");
//                    break;
//                }
//            }

            updateChartData(chart);

            chartlist.add(chart);
        }
        return chartlist;
    }

    /**
     * 在报表中新建图表
     */
    @Override
    public Long insertIntoFormChart(FormChart formChart) {
//        formChart.setCreateTime(DateUtils.getNowDate());
        formChartService.insertFormChart(formChart);

        //插入报表图表对应表
        FormChooseChart fcc = new FormChooseChart();
        fcc.setFormId(formChart.getFormId());
        fcc.setChartId(formChart.getChartId());
        formChooseChartMapper.insertFormChooseChart(fcc);

        FormChartParam fcp = new FormChartParam();
        fcp.setChartId(formChart.getChartId());
        fcp.setParaName("default");
        //插入图表参数对应表
        switch (formChart.getChartType()){
            case "基础折线图":
            case "基础柱状图":
            case "合并累加排序柱状图":
            case "帕累托图":
            case "基础饼状图":
            case "环形图":
            case "南丁格尔玫瑰图":{
                for (int i=0;i<3;i++){
                    fcp.setParaSort(i);
                    formChartParamMapper.insertFormChartParam(fcp);
                }
                break;
            }
            case "多数据柱状图":
            case "折线柱状图":
            case "堆叠柱状图":{
                for (int i=0;i<4;i++){
                    fcp.setParaSort(i);
                    formChartParamMapper.insertFormChartParam(fcp);
                }
                break;
            }
            case "基础雷达图":{
                for (int i=0;i<8;i++){
                    fcp.setParaSort(i);
                    formChartParamMapper.insertFormChartParam(fcp);
                }
                break;
            }
            default:{
                System.out.println("没有这种类型的图表");
                break;
            }
        }
        return formChart.getChartId();
    }

    /**
     * 在报表中修改图表
     */
    @Override
    public FormChart updateFormChart(FormChart formChart) {
//        formChart.setUpdateTime(DateUtils.getNowDate());
        formChartService.updateFormChart(formChart);

        List<String> cpl=formChart.getParalist();
        FormChartParam fcp=new FormChartParam();
        fcp.setChartId(formChart.getChartId());
        for (int i=0;i<cpl.size();i++){
            fcp.setParaSort(i);
            fcp.setParaName(cpl.get(i));
            formChartParamService.updateByChartSort(fcp);
        }

        updateChartData(formChart);

        return formChart;
    }

    /**
     * 在报表中删除图表
     */
    @Override
    public Long deleteFormChart(Long chartId, Long formId) {
        FormChooseChart fcc=new FormChooseChart();
        fcc.setChartId(chartId);
        fcc.setFormId(formId);
        formChooseChartService.deleteByFromIdAndChartId(fcc);
        fcc.setFormId(null);

        List<FormChooseChart> temp=formChooseChartService.selectFormChooseChartList(fcc);

        if (temp.size()>0){
            return null;
        }

        formChartService.deleteFormChartByChartId(chartId);
        formChartParamService.deleteFormChartParamByChartId(chartId);
        return null;
    }

    /**
     * 获取折线图
     */
    @Override
    public HashMap<String, Object> getlineChart(String tableName, String xcolumn, String ycolumn) {
        List<String> horiList=getDataByTableColumn(tableName,xcolumn);
        List<String> vertList=getDataByTableColumn(tableName,ycolumn);

        HashMap<String, Object> map = new HashMap<>();
        map.put("horiList",horiList);
        map.put("vertList",vertList);
        return map;
    }

    /**
     * 获取基础柱状图
     */
    @Override
    public HashMap<String, Object> getSimplebarChart(String tableName, String xcolumn, String ycolumn) {
        List<String> horiList=getDataByTableColumn(tableName,xcolumn);
        List<String> vertList=getDataByTableColumn(tableName,ycolumn);

        HashMap<String, Object> map = new HashMap<>();
        map.put("horiList",horiList);
        map.put("vertList",vertList);
        return map;
    }

    /**
     * 获取堆叠柱状图
     */
    @Override
    public HashMap<String, Object> getStackedColumnChart(String tableName, String xcolumn, String ycolumn, String type) {
        List<String> horiList=getDistinctDataByTableColumn(tableName,xcolumn);
        List<String> typeList=getDistinctDataByTableColumn(tableName,type);
        List<StackColumnData> vertList=getStackColumnData(tableName,xcolumn,ycolumn,type,horiList,typeList);

        HashMap<String, Object> map = new HashMap<>();
        map.put("horiList",horiList);
        map.put("typeList",typeList);
        map.put("vertList",vertList);
        return map;
    }

    /**
     * 获取多数据柱状图
     */
    @Override
    public HashMap<String, Object> getMulDataChart(String tableName, String xcolumn, String ycolumn, String type) {
        List<String> horiList=getDistinctDataByTableColumn(tableName,xcolumn);
        List<String> typeList=getDistinctDataByTableColumn(tableName,type);
        List<StackColumnData> vertList=getMulData(tableName,xcolumn,ycolumn,type,horiList,typeList);

        HashMap<String, Object> map = new HashMap<>();
        map.put("horiList",horiList);
        map.put("typeList",typeList);
        map.put("vertList",vertList);
        return map;
    }

    /**
     * 获取折线柱状图
     */
    @Override
    public HashMap<String, Object> getLineColumnChart(String tableName, String xcolumn, String ycolumn1, String ycolumn2) {
        List<String> horiList=getDataByTableColumn(tableName,xcolumn);
        List<String> vertList1=getDataByTableColumn(tableName,ycolumn1);
        List<String> vertList2=getDataByTableColumn(tableName,ycolumn2);

        List<String> legendList=new ArrayList<>();
        legendList.add(ycolumn1);
        legendList.add(ycolumn2);

        HashMap<String, Object> map = new HashMap<>();
        map.put("horiList",horiList);
        map.put("legend",legendList);
        map.put("vertList1",vertList1);
        map.put("vertList2",vertList2);
        return map;
    }

    /**
     * 获取帕累托图
     */
    @Override
    public HashMap<String, Object> getParetoChart(String tableName, String xcolumn, String ycolumn) {
        List<String> temhoriList=getDataByTableColumn(tableName,xcolumn);
        List<String> temvertList=getDataByTableColumn(tableName,ycolumn);;
        List<String> horiList=new ArrayList<>();
        List<String> vertList=new ArrayList<>();
        List<String> legend=new ArrayList<>();
        List<String> bateList=new ArrayList<>();

        List<ParetoData> paretoDataList=new ArrayList<>();
        float sum=0;
        float tempbate=0;

        for(int i=0;i<temhoriList.size();i++){
            ParetoData paretoData = new ParetoData();
            float temvalue=Float.parseFloat(temvertList.get(i));

            paretoData.setXname(temhoriList.get(i));
            paretoData.setYvalue(temvalue);
            sum+=temvalue;
            paretoDataList.add(paretoData);
        }

        Comparator<ParetoData> comparing = Comparator.comparing(ParetoData::getYvalue).reversed();
        paretoDataList.sort(comparing);

        java.text.NumberFormat numberformat=java.text.NumberFormat.getInstance();
        numberformat.setMaximumFractionDigits(2);
        for (int i=0;i<temhoriList.size();i++){
            tempbate+=paretoDataList.get(i).getYvalue()/sum*100;
            if (tempbate<=100) {
                bateList.add(numberformat.format(tempbate));
            }
            else {
                bateList.add("100.00");
            }
            horiList.add(paretoDataList.get(i).getXname());
            vertList.add(String.valueOf(paretoDataList.get(i).getYvalue()));
        }
        legend.add(ycolumn);
        legend.add("百分比");

        HashMap<String, Object> map = new HashMap<>();
        map.put("horiList",horiList);
        map.put("legend",legend);
        map.put("vertList1",vertList);
        map.put("vertList2",bateList);
        return map;
    }

    /**
     * 获取合并累加排序柱状图
     */
    @Override
    public HashMap<String, Object> getSumSortChart(String tableName, String xcolumn, String ycolumn) {
        List<Map> maplist=formMapper.getDistinctSumColumn(tableName,xcolumn,ycolumn);

        List<String> horiList=new ArrayList<>();
//        List<String> horiList2=maplist.stream().map(n->n.get(xcolumn)).collect(Collectors.toList());
        List<String> vertList=new ArrayList<>();

        for(int i=0;i<maplist.size();i++){
            horiList.add(maplist.get(i).get(xcolumn).toString());
            vertList.add(maplist.get(i).get("sum("+ycolumn+")").toString());
        }

        HashMap<String, Object> map = new HashMap<>();
        map.put("horiList",horiList);
        map.put("vertList",vertList);
        return map;
    }

    /**
     * 获取饼状图(基础饼状图、环形图、南丁格尔玫瑰图)
     */
    @Override
    public HashMap<String, Object> getPieChart(String tableName, String xcolumn, String ycolumn) {
        List<String> horiList=getDataByTableColumn(tableName,xcolumn);
        List<String> vertList1=getDataByTableColumn(tableName,ycolumn);

        List<PieChartData> dataList=new ArrayList<>();

        for(int i=0;i<horiList.size();i++){
            PieChartData piedata = new PieChartData();
            piedata.setName(horiList.get(i));
            piedata.setValue(Integer.parseInt(vertList1.get(i)));
            dataList.add(piedata);
        }

        HashMap<String, Object> map = new HashMap<>();
        map.put("data",dataList);
        return map;
    }

    /**
     * 获取雷达图
     */
    @Override
    public HashMap<String, Object> getRadarChart(String tableName, String xcolumn, String ycolumn1, String ycolumn2, String ycolumn3, String ycolumn4, String ycolumn5, String ycolumn6) {
        List<String> horiList=getDataByTableColumn(tableName,xcolumn);
        List<String> vertList1=getDataByTableColumn(tableName,ycolumn1);
        List<String> vertList2=getDataByTableColumn(tableName,ycolumn2);
        List<String> vertList3=getDataByTableColumn(tableName,ycolumn3);
        List<String> vertList4=getDataByTableColumn(tableName,ycolumn4);
        List<String> vertList5=getDataByTableColumn(tableName,ycolumn5);
        List<String> vertList6=getDataByTableColumn(tableName,ycolumn6);
        List<String> columnList=new ArrayList<>();
        columnList.add(ycolumn1);
        columnList.add(ycolumn2);
        columnList.add(ycolumn3);
        columnList.add(ycolumn4);
        columnList.add(ycolumn5);
        columnList.add(ycolumn6);


        List<RadarData> radarDataList=new ArrayList<>();

        for(int i=0;i<horiList.size();i++){
            RadarData radarData = new RadarData();
            ArrayList<Integer> valueList=new ArrayList<>();

            radarData.setName(horiList.get(i));
            valueList.add(Integer.parseInt((vertList1.get(i))));
            valueList.add(Integer.parseInt((vertList2.get(i))));
            valueList.add(Integer.parseInt((vertList3.get(i))));
            valueList.add(Integer.parseInt((vertList4.get(i))));
            valueList.add(Integer.parseInt((vertList5.get(i))));
            valueList.add(Integer.parseInt((vertList6.get(i))));

            radarData.setValue(valueList);
            radarDataList.add(radarData);
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("name",columnList);
        map.put("data",radarDataList);
        return map;
    }



    @Override
    public List<Object> getDataByTable(String tableName) {
        return formMapper.getDataByTable(tableName);
    }

    @Override
    public List<String> getDataByTableColumn(String tableName, String Column) {
        return formMapper.getDataByTableColumn(tableName,Column);
    }

    @Override
    public List<String> getDistinctDataByTableColumn(String tableName, String Column) {
        return formMapper.getDistinctDataByTableColumn(tableName,Column);
    }

    @Override
    public List<StackColumnData> getStackColumnData(String tableName,
                                                          String xcolumn,
                                                          String ycolumn,
                                                          String type,
                                                          List<String> horiList,
                                                          List<String> typeList) {
        List<StackColumnData> verlist= new ArrayList<>();
        for (String typepara:typeList){
            StackColumnData st=new StackColumnData();
            StackColumnDataEmphasis ste=new StackColumnDataEmphasis();
            List<String> temp=new ArrayList<>();
            for (String hori:horiList){
                String t=formMapper.getYByOneXManyRecord(tableName,ycolumn,xcolumn,type,hori,typepara);
                temp.add(t == null ?"0":t);
            }
            st.setName(typepara);
            st.setType("bar");
            st.setStack(type);
            st.setData(temp);
            ste.setFocus("series");
            st.setEmphasis(ste);

            verlist.add(st);
        }
        return verlist;
    }


    public List<StackColumnData> getMulData(String tableName,
                                                    String xcolumn,
                                                    String ycolumn,
                                                    String type,
                                                    List<String> horiList,
                                                    List<String> typeList) {
        List<StackColumnData> verlist= new ArrayList<>();
        for (String typepara:typeList){
            StackColumnData st=new StackColumnData();
            List<String> temp=new ArrayList<>();
            for (String hori:horiList){
                String t=formMapper.getYByOneXManyRecord(tableName,ycolumn,xcolumn,type,hori,typepara);
                temp.add(t == null ?"0":t);
            }
            st.setName(typepara);
            st.setType("bar");
            st.setStack(typepara);
            st.setData(temp);
            st.setEmphasis(new StackColumnDataEmphasis("series"));
            verlist.add(st);
        }
        return verlist;
    }


    ///////////////////辅助函数//////////////////////////
    /* 在参数类型更新完成后，依据不同的图标类别，更新图表的data值 */
    private void updateChartData(FormChart chart){
        List<String> para=chart.getParalist();
        switch (chart.getChartType()){
            case "基础折线图": {
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("基础折线图"));
                }else {
                    chart.setData(getlineChart(para.get(0),para.get(1),para.get(2)));
                }
                break;
            }
            case "基础柱状图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("基础柱状图"));
                }else {
                    chart.setData(getSimplebarChart(para.get(0),para.get(1),para.get(2)));
                }
                break;
            }
            case "堆叠柱状图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("堆叠柱状图"));
                }else {
                    chart.setData(getStackedColumnChart(para.get(0),para.get(1),para.get(2), para.get(3)));
                }
                break;
            }
            case "多数据柱状图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("多数据柱状图"));
                }else {
                    chart.setData(getMulDataChart(para.get(0),para.get(1),para.get(2), para.get(3)));
                }
                break;
            }
            case "折线柱状图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("折线柱状图"));
                }else {
                    chart.setData(getLineColumnChart(para.get(0),para.get(1),para.get(2), para.get(3)));
                }
                break;
            }
            case "帕累托图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("帕累托图"));
                }else {
                    chart.setData(getParetoChart(para.get(0),para.get(1),para.get(2)));
                }
                break;
            }
            case "合并累加排序柱状图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("合并累加排序柱状图"));
                }else {
                    chart.setData(getSumSortChart(para.get(0),para.get(1),para.get(2)));
                }
                break;
            }
            case "基础饼状图":
            case "环形图":
            case "南丁格尔玫瑰图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("饼状图"));
                }else {
                    chart.setData(getPieChart(para.get(0),para.get(1),para.get(2)));
                }
                break;
            }
            case "基础雷达图":{
                if (para.get(0).equals("default")){
                    chart.setData(getDefaultData("基础雷达图"));
                }else {
                    chart.setData(getRadarChart(para.get(0),para.get(1),para.get(2),para.get(3),para.get(4),para.get(5),para.get(6),para.get(7)));
                }
                break;
            }
            default:{
                System.out.println("出现未整合图表类型");
                break;
            }
        }
    }

    private HashMap<String,Object> getDefaultData(String type){
        switch (type){
            case "基础折线图":
            case "基础柱状图":{
                HashMap<String,Object> defLineChart=new HashMap<>();
                List<String> xlist = Arrays.asList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
                List<String> ylist = Arrays.asList("150", "230", "224", "218", "135", "147", "260");
                defLineChart.put("horiList",xlist);
                defLineChart.put("vertList",ylist);
                return defLineChart;
            }
            case "堆叠柱状图":{
                HashMap<String,Object> defStackChart=new HashMap<>();
                List<String> xlist = Arrays.asList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
                List<String> typeList = Arrays.asList("Direct", "Email");
                List<StackColumnData> ylist = new ArrayList<>();
                StackColumnData st = new StackColumnData();
                StackColumnData st2 = new StackColumnData();
                st.setName("Direct");
                st2.setName("Email");
                st.setType("bar");
                st2.setType("bar");
                st.setStack("Ad");
                st2.setStack("Ad");
                st.setEmphasis(new StackColumnDataEmphasis("series"));
                st2.setEmphasis(new StackColumnDataEmphasis("series"));
                st.setData(Arrays.asList("150", "232", "201", "154", "190", "330", "410"));
                st2.setData(Arrays.asList("120", "132", "101", "134", "90", "230", "210"));
                ylist.add(st);
                ylist.add(st2);
                defStackChart.put("horiList",xlist);
                defStackChart.put("typeList",typeList);
                defStackChart.put("vertList",ylist);
                return defStackChart;
            }
            case "多数据柱状图":{
                HashMap<String,Object> mulChart=new HashMap<>();
                List<String> xlist = Arrays.asList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
                List<String> typeList = Arrays.asList("Direct", "Email");
                List<StackColumnData> ylist = new ArrayList<>();
                StackColumnData st = new StackColumnData();
                StackColumnData st2 = new StackColumnData();
                st.setName("Direct");
                st2.setName("Email");
                st.setType("bar");
                st2.setType("bar");
                st.setStack("Direct");
                st2.setStack("Email");
                st.setEmphasis(new StackColumnDataEmphasis("series"));
                st2.setEmphasis(new StackColumnDataEmphasis("series"));
                st.setData(Arrays.asList("150", "232", "201", "154", "190", "330", "410"));
                st2.setData(Arrays.asList("120", "132", "101", "134", "90", "230", "210"));
                ylist.add(st);
                ylist.add(st2);
                mulChart.put("horiList",xlist);
                mulChart.put("typeList",typeList);
                mulChart.put("vertList",ylist);
                return mulChart;
            }
            case "折线柱状图":{
                HashMap<String,Object> defLineColumn=new HashMap<>();
                List<String> xlist=Arrays.asList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
                List<String> ylist1=Arrays.asList("9.0", "26.4", "70.7", "175.6", "182.2", "48.7", "18.8");
                List<String> ylist2=Arrays.asList("2.0", "6.3", "10.2", "20.3", "23.4", "16.5", "12.0");
                List<String> legendlist=Arrays.asList("Precipitation","Temperature");
                defLineColumn.put("horiList",xlist);
                defLineColumn.put("legend",legendlist);
                defLineColumn.put("vertList1",ylist1);
                defLineColumn.put("vertList2",ylist2);
                return defLineColumn;
            }
            case "合并累加排序柱状图":{
                HashMap<String,Object> defSumSortChart=new HashMap<>();
                List<String> xlist = Arrays.asList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
                List<String> ylist = Arrays.asList("260", "230", "224", "218", "150", "147", "135");
                defSumSortChart.put("horiList",xlist);
                defSumSortChart.put("vertList",ylist);
                return defSumSortChart;
            }
            case "帕累托图":{
                HashMap<String,Object> defLineColumn=new HashMap<>();
                List<String> xlist=Arrays.asList("导入收费信息", "Start Tenant...", "病例", "刷全部诊所...", "更新病例汇...", "导入预约模块", "导入患者", "随访", "新增患者家...", "修正患者联...");
                List<String> ylist1=Arrays.asList("1380", "300", "198", "120", "115", "78", "75", "56", "56", "48");
                List<String> ylist2=Arrays.asList("70.00", "73.00", "80.00", "82.00", "90.00", "91.00", "92.00", "93.00", "98.00", "100.00");
                List<String> legendlist=Arrays.asList("分钟", "百分比");
                defLineColumn.put("horiList",xlist);
                defLineColumn.put("legend",legendlist);
                defLineColumn.put("vertList1",ylist1);
                defLineColumn.put("vertList2",ylist2);
                return defLineColumn;
            }
            case "饼状图":{
                HashMap<String,Object> defLineChart=new HashMap<>();
                List<PieChartData> pieChartData=Arrays.asList(new PieChartData(1048,"Search Engine"),
                                                              new PieChartData(735,"Direct"),
                                                              new PieChartData(580,"Email"),
                                                              new PieChartData(484,"Union Ads"),
                                                              new PieChartData(300,"Video Ads"));
                defLineChart.put("data",pieChartData);
                return defLineChart;
            }
            case "基础雷达图":{
                HashMap<String,Object> radarChart=new HashMap<>();
                List<RadarData> radarDataList=Arrays.asList(new RadarData(new ArrayList<>(Arrays.asList(4200, 3000, 20000, 35000, 50000, 18000)),"Allocated Budget"),
                                                            new RadarData(new ArrayList<>(Arrays.asList(5000, 14000, 28000, 26000, 42000, 21000)),"Actual Spending"));
                radarChart.put("data",radarDataList);
                radarChart.put("name",new ArrayList<>(Arrays.asList("Sales","Administration","Information","Customer Support","Development","Marketing")));
                return radarChart;
            }
            default:{
                return null;
            }
        }
    }
}
